<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    for(let i = 0;i<10;i++){
        console.log(i);
    }

    //计算1~100的和并打印结果
    let sum=0;
    for(let i = 1;i<=100;i++){
        sum+=i;
    }
    console.log(sum);

    //计算1~100之间偶数的和
    let even=0;
    let odd=0;
    for(let i=1;i<=100;i++){
       if(i%2==0){
        even +=i;
       } 
     else {
        odd +=i;
    }
}
    console.log('1~100之间所有偶数的和为'+even);
    console.log('1~100之间所有奇数的和为'+odd);

    //while循环和do...while循环
    let a = 10;
    while(a>10){
        console.log('执行while循环');
    }

    let b = 10;
    do{
        console.log('执行do...while循环');
    }while(b>10)

    //嵌套循环
    for(let i = 0;i<5;i++){
        for (let j = 0;j<5;j++){
            console.log(i+':'+j);
        }
    }

    /*
    1.打印效果：
    *****
    *****
    *****
    *****
    2.打印九九乘法表并画出流程图
    */
   
</script>
</html>